﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace netcore8.InjectInterface
{
    public class Product2CSService : IProduct2Service
    {
        public IProduct2Repository _productRepository { set; get; }

        public Product2CSService(IProduct2Repository productRepository) { 
            //使用了接口，这里接收就都有要用接口
            this._productRepository = productRepository;
        }
    
        public void GetProduct() {
            _productRepository.GetProduct();
            Console.WriteLine($"查询CS商品成功：{this.GetHashCode()}");
        }
    }
}
